<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QHexEdit: /media/winni/sda8/working_copy/working_copy/hacking/c++/qhexedit2/src/qhexedit.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QHexEdit
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">qhexedit.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef QHEXEDIT_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define QHEXEDIT_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;QAbstractScrollArea&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;QPen&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;QBrush&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;chunks.h&quot;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;commands.h&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#ifdef QHEXEDIT_EXPORTS</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#define QHEXEDIT_API Q_DECL_EXPORT</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#elif QHEXEDIT_IMPORTS</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#define QHEXEDIT_API Q_DECL_IMPORT</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#define QHEXEDIT_API</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html">   59</a></span>&#160;<span class="keyword">class </span>QHEXEDIT_API <a class="code" href="class_q_hex_edit.html">QHexEdit</a> : <span class="keyword">public</span> QAbstractScrollArea</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;{</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    Q_OBJECT</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#aeaa9f3751f53b91df51cfd2863bf48ee">   66</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">bool</span> addressArea READ addressArea WRITE setAddressArea)</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    </div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a6e27b73514e243c0b8b2a3efafbb5e32">   71</a></span>&#160;    Q_PROPERTY(QColor addressAreaColor READ addressAreaColor WRITE setAddressAreaColor)</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#afe1e80827cacce84505f8b0ef6421a0a">   78</a></span>&#160;    Q_PROPERTY(qint64 addressOffset READ addressOffset WRITE setAddressOffset)</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a11b672fd38a7c48949ccce3228474b2f">   82</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">int</span> addressWidth READ addressWidth WRITE setAddressWidth)</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a0e297a4a212a9d7addbbf82472e1acb2">   86</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">bool</span> asciiArea READ asciiArea WRITE setAsciiArea)</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#afec14c7e26b2b98f250d4cc3df822972">   89</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">int</span> bytesPerLine READ bytesPerLine WRITE setBytesPerLine)</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#aa50b3ebe0d22133891dce0c8237846c7">   95</a></span>&#160;    Q_PROPERTY(qint64 cursorPosition READ cursorPosition WRITE setCursorPosition)</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a7f4e532611a6eff27b75d3cb88e91618">  102</a></span>&#160;    Q_PROPERTY(QByteArray data READ data WRITE setData NOTIFY dataChanged)</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a4edfedb78ed9ae52cd08436e7cca0285">  107</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">bool</span> hexCaps READ hexCaps WRITE setHexCaps)</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a788d65f5556535a49879a3a052a9a313">  111</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">bool</span> dynamicBytesPerLine READ dynamicBytesPerLine WRITE setDynamicBytesPerLine)</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#ae3669260a4d5c2fad5651893a17258fd">  115</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">bool</span> highlighting READ highlighting WRITE setHighlighting)</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a9e8ed54e47fec94cfd64b14ea1f7cee8">  121</a></span>&#160;    Q_PROPERTY(QColor highlightingColor READ highlightingColor WRITE setHighlightingColor)</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a941a91c36eb8429c41096bfcd45f38c1">  128</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">bool</span> overwriteMode READ overwriteMode WRITE setOverwriteMode)</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#ac0b628f34316aff9e18fc73a738250d7">  134</a></span>&#160;    Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor)</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#acb3044d1bb0c99876ddfa33772e91209">  141</a></span>&#160;    Q_PROPERTY(<span class="keywordtype">bool</span> readOnly READ isReadOnly WRITE setReadOnly)</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="class_q_hex_edit.html#a9579dc7273c48b89c9e4f26adda78671">  144</a></span>&#160;    Q_PROPERTY(QFont font READ font WRITE setFont)</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;public:</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <a class="code" href="class_q_hex_edit.html">QHexEdit</a>(QWidget *parent=0);</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="comment">// Access to data of qhexedit</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordtype">bool</span> setData(QIODevice &amp;iODevice);</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    QByteArray dataAt(qint64 pos, qint64 count=-1);</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordtype">bool</span> write(QIODevice &amp;iODevice, qint64 pos=0, qint64 count=-1);</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="comment">// Char handling</span></div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <span class="keywordtype">void</span> insert(qint64 pos, <span class="keywordtype">char</span> ch);</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordtype">void</span> remove(qint64 pos, qint64 len=1);</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keywordtype">void</span> replace(qint64 pos, <span class="keywordtype">char</span> ch);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="comment">// ByteArray handling</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="keywordtype">void</span> insert(qint64 pos, const QByteArray &amp;ba);</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="keywordtype">void</span> replace(qint64 pos, qint64 len, const QByteArray &amp;ba);</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="comment">// Utility functions</span></div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="comment"></span>    qint64 cursorPosition(QPoint point);</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordtype">void</span> ensureVisible();</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    qint64 indexOf(const QByteArray &amp;ba, qint64 from);</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <span class="keywordtype">bool</span> isModified();</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    qint64 lastIndexOf(const QByteArray &amp;ba, qint64 from);</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    QString selectionToReadableString();</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    QString selectedData();</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    <span class="keywordtype">void</span> setFont(const QFont &amp;font);</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    QString toReadableString();</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;public slots:</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    <span class="keywordtype">void</span> redo();</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <span class="keywordtype">void</span> undo();</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;signals:</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    <span class="keywordtype">void</span> currentAddressChanged(qint64 address);</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <span class="keywordtype">void</span> currentSizeChanged(qint64 size);</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="keywordtype">void</span> dataChanged();</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <span class="keywordtype">void</span> overwriteModeChanged(<span class="keywordtype">bool</span> state);</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;public:</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    ~<a class="code" href="class_q_hex_edit.html">QHexEdit</a>();</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="comment">// Properties</span></div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    <span class="keywordtype">bool</span> addressArea();</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    <span class="keywordtype">void</span> setAddressArea(<span class="keywordtype">bool</span> addressArea);</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    QColor addressAreaColor();</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    <span class="keywordtype">void</span> setAddressAreaColor(const QColor &amp;color);</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    qint64 addressOffset();</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;    <span class="keywordtype">void</span> setAddressOffset(qint64 addressArea);</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    <span class="keywordtype">int</span> addressWidth();</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    <span class="keywordtype">void</span> setAddressWidth(<span class="keywordtype">int</span> addressWidth);</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    <span class="keywordtype">bool</span> asciiArea();</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    <span class="keywordtype">void</span> setAsciiArea(<span class="keywordtype">bool</span> asciiArea);</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <span class="keywordtype">int</span> bytesPerLine();</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;    <span class="keywordtype">void</span> setBytesPerLine(<span class="keywordtype">int</span> count);</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    qint64 cursorPosition();</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;    <span class="keywordtype">void</span> setCursorPosition(qint64 position);</div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    QByteArray data();</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    <span class="keywordtype">void</span> setData(const QByteArray &amp;ba);</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    <span class="keywordtype">void</span> setHexCaps(const <span class="keywordtype">bool</span> isCaps);</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    <span class="keywordtype">bool</span> hexCaps();</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="keywordtype">void</span> setDynamicBytesPerLine(const <span class="keywordtype">bool</span> isDynamic);</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;    <span class="keywordtype">bool</span> dynamicBytesPerLine();</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <span class="keywordtype">bool</span> highlighting();</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    <span class="keywordtype">void</span> setHighlighting(<span class="keywordtype">bool</span> mode);</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    QColor highlightingColor();</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    <span class="keywordtype">void</span> setHighlightingColor(const QColor &amp;color);</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;    <span class="keywordtype">bool</span> overwriteMode();</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    <span class="keywordtype">void</span> setOverwriteMode(<span class="keywordtype">bool</span> overwriteMode);</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    <span class="keywordtype">bool</span> isReadOnly();</div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    <span class="keywordtype">void</span> setReadOnly(<span class="keywordtype">bool</span> readOnly);</div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    QColor selectionColor();</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    <span class="keywordtype">void</span> setSelectionColor(const QColor &amp;color);</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;protected:</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    <span class="comment">// Handle events</span></div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    <span class="keywordtype">void</span> keyPressEvent(QKeyEvent *event);</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    <span class="keywordtype">void</span> mouseMoveEvent(QMouseEvent * event);</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    <span class="keywordtype">void</span> mousePressEvent(QMouseEvent * event);</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    <span class="keywordtype">void</span> paintEvent(QPaintEvent *event);</div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    <span class="keywordtype">void</span> resizeEvent(QResizeEvent *);</div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    virtual <span class="keywordtype">bool</span> focusNextPrevChild(<span class="keywordtype">bool</span> next);</div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;private:</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;    <span class="comment">// Handle selections</span></div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    <span class="keywordtype">void</span> resetSelection(qint64 pos);            <span class="comment">// set selectionStart and selectionEnd to pos</span></div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;    <span class="keywordtype">void</span> resetSelection();                      <span class="comment">// set selectionEnd to selectionStart</span></div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;    <span class="keywordtype">void</span> setSelection(qint64 pos);              <span class="comment">// set min (if below init) or max (if greater init)</span></div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;    qint64 getSelectionBegin();</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    qint64 getSelectionEnd();</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    <span class="comment">// Private utility functions</span></div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    <span class="keywordtype">void</span> init();</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    <span class="keywordtype">void</span> readBuffers();</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;    QString toReadable(const QByteArray &amp;ba);</div><div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;</div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;private slots:</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    <span class="keywordtype">void</span> adjust();                              <span class="comment">// recalc pixel positions</span></div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;    <span class="keywordtype">void</span> dataChangedPrivate(<span class="keywordtype">int</span> idx=0);         <span class="comment">// emit dataChanged() signal</span></div><div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;    <span class="keywordtype">void</span> refresh();                             <span class="comment">// ensureVisible() and readBuffers()</span></div><div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;    <span class="keywordtype">void</span> updateCursor();                        <span class="comment">// update blinking cursor</span></div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;private:</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="comment">// Name convention: pixel positions start with _px</span></div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;    <span class="keywordtype">int</span> _pxCharWidth, _pxCharHeight;            <span class="comment">// char dimensions (dependend on font)</span></div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;    <span class="keywordtype">int</span> _pxPosHexX;                             <span class="comment">// X-Pos of HeaxArea</span></div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    <span class="keywordtype">int</span> _pxPosAdrX;                             <span class="comment">// X-Pos of Address Area</span></div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    <span class="keywordtype">int</span> _pxPosAsciiX;                           <span class="comment">// X-Pos of Ascii Area</span></div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    <span class="keywordtype">int</span> _pxGapAdr;                              <span class="comment">// gap left from AddressArea</span></div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    <span class="keywordtype">int</span> _pxGapAdrHex;                           <span class="comment">// gap between AddressArea and HexAerea</span></div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    <span class="keywordtype">int</span> _pxGapHexAscii;                         <span class="comment">// gap between HexArea and AsciiArea</span></div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;    <span class="keywordtype">int</span> _pxCursorWidth;                         <span class="comment">// cursor width</span></div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;    <span class="keywordtype">int</span> _pxSelectionSub;                        <span class="comment">// offset selection rect</span></div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    <span class="keywordtype">int</span> _pxCursorX;                             <span class="comment">// current cursor pos</span></div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    <span class="keywordtype">int</span> _pxCursorY;                             <span class="comment">// current cursor pos</span></div><div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;</div><div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    <span class="comment">// Name convention: absolute byte positions in chunks start with _b</span></div><div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;    qint64 _bSelectionBegin;                    <span class="comment">// first position of Selection</span></div><div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;    qint64 _bSelectionEnd;                      <span class="comment">// end of Selection</span></div><div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;    qint64 _bSelectionInit;                     <span class="comment">// memory position of Selection</span></div><div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    qint64 _bPosFirst;                          <span class="comment">// position of first byte shown</span></div><div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;    qint64 _bPosLast;                           <span class="comment">// position of last byte shown</span></div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;    qint64 _bPosCurrent;                        <span class="comment">// current position</span></div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;</div><div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;    <span class="comment">// variables to store the property values</span></div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;    <span class="keywordtype">bool</span> _addressArea;                          <span class="comment">// left area of QHexEdit</span></div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;    QColor _addressAreaColor;</div><div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;    <span class="keywordtype">int</span> _addressWidth;</div><div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;    <span class="keywordtype">bool</span> _asciiArea;</div><div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;    qint64 _addressOffset;</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;    <span class="keywordtype">int</span> _bytesPerLine;</div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;    <span class="keywordtype">int</span> _hexCharsInLine;</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;    <span class="keywordtype">bool</span> _highlighting;</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    <span class="keywordtype">bool</span> _overwriteMode;</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    QBrush _brushSelection;</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;    QPen _penSelection;</div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;    QBrush _brushHighlighted;</div><div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;    QPen _penHighlighted;</div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;    <span class="keywordtype">bool</span> _readOnly;</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;    <span class="keywordtype">bool</span> _hexCaps;</div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    <span class="keywordtype">bool</span> _dynamicBytesPerLine;</div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;</div><div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;    <span class="comment">// other variables</span></div><div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;    <span class="keywordtype">bool</span> _editAreaIsAscii;                      <span class="comment">// flag about the ascii mode edited</span></div><div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;    <span class="keywordtype">int</span> _addrDigits;                            <span class="comment">// real no of addressdigits, may be &gt; addressWidth</span></div><div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;    <span class="keywordtype">bool</span> _blink;                                <span class="comment">// help get cursor blinking</span></div><div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;    QBuffer _bData;                             <span class="comment">// buffer, when setup with QByteArray</span></div><div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;    Chunks *_chunks;                            <span class="comment">// IODevice based access to data</span></div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;    QTimer _cursorTimer;                        <span class="comment">// for blinking cursor</span></div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;    qint64 _cursorPosition;                     <span class="comment">// absolute position of cursor, 1 Byte == 2 tics</span></div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;    QRect _cursorRect;                          <span class="comment">// physical dimensions of cursor</span></div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;    QByteArray _data;                           <span class="comment">// QHexEdit&#39;s data, when setup with QByteArray</span></div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;    QByteArray _dataShown;                      <span class="comment">// data in the current View</span></div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;    QByteArray _hexDataShown;                   <span class="comment">// data in view, transformed to hex</span></div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    qint64 _lastEventSize;                      <span class="comment">// size, which was emitted last time</span></div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;    QByteArray _markedShown;                    <span class="comment">// marked data in view</span></div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    <span class="keywordtype">bool</span> _modified;                             <span class="comment">// Is any data in editor modified?</span></div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    <span class="keywordtype">int</span> _rowsShown;                             <span class="comment">// lines of text shown</span></div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    UndoStack * _undoStack;                     <span class="comment">// Stack to store edit actions for undo/redo</span></div><div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;<span class="comment"></span>};</div><div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;</div><div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;<span class="preprocessor">#endif // QHEXEDIT_H</span></div><div class="ttc" id="class_q_hex_edit_html"><div class="ttname"><a href="class_q_hex_edit.html">QHexEdit</a></div><div class="ttdef"><b>Definition:</b> qhexedit.h:59</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Mar 16 2019 17:03:27 for QHexEdit by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
